Ray tracing is a computer graphics technique used to generate 3D images for display. More specifically, ray tracing is the process of tracing three-dimensional (3D) rays through a 3D scene and finding ray-primitive intersections so that a two-dimensional (2D) representation of the 3D scene may be displayed. One technique used in ray tracing is determining ray-triangle intersections. Given an input ray and a set of triangles, the goal of the algorithm is to determine which triangles are intersected by the ray, and/or a set of intersection points. In order to accelerate the ray tracing operation, primitives (e.g., triangles) are typically organized into an acceleration data structure (ADS) that hierarchically groups scene primitives.
Examples of accelerated data structures include a bounding volume hierarchy (BVH) tree, k-dimensional (KD) tree, grid, etc. The ADS may be recursively traversed by performing ray intersection tests on the hierarchy of scene primitives to determine the primitives of the scene that are intersected by the ray. In order to trace a ray through a BVH tree, two types of operations are typically used: ray-box intersection testing (e.g., ray-AABB (axis-aligned bounding box) intersection testing), and ray-triangle intersection testing.